.class public Lcom/instagram/android/directshare/b/a/g;
.super Lcom/instagram/android/d/k/b;
.source "ConfigureDirectShareRequest.java"


# instance fields
.field private final a:Lcom/instagram/pendingmedia/model/c;


# direct methods
.method public constructor <init>(Lcom/instagram/pendingmedia/model/c;)V
    .locals 0
    .parameter

    .prologue
    .line 25
    invoke-direct {p0}, Lcom/instagram/android/d/k/b;-><init>()V

    .line 26
    iput-object p1, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    .line 27
    return-void
.end method

.method private a(Ljava/util/List;)Ljava/lang/String;
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;)",
            "Ljava/lang/String;"
        }
    .end annotation

    .prologue
    .line 63
    new-instance v0, Ljava/io/StringWriter;

    invoke-direct {v0}, Ljava/io/StringWriter;-><init>()V

    .line 64
    invoke-virtual {p0}, Lcom/instagram/android/directshare/b/a/g;->j()Lcom/fasterxml/jackson/a/e;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/fasterxml/jackson/a/e;->createGenerator(Ljava/io/Writer;)Lcom/fasterxml/jackson/a/h;

    move-result-object v1

    .line 65
    new-instance v2, Lcom/fasterxml/jackson/databind/ObjectMapper;

    invoke-direct {v2}, Lcom/fasterxml/jackson/databind/ObjectMapper;-><init>()V

    .line 67
    invoke-virtual {v2, v1, p1}, Lcom/fasterxml/jackson/databind/ObjectMapper;->writeValue(Lcom/fasterxml/jackson/a/h;Ljava/lang/Object;)V

    .line 68
    invoke-virtual {v1}, Lcom/fasterxml/jackson/a/h;->close()V

    .line 70
    invoke-virtual {v0}, Ljava/io/StringWriter;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method protected a(Lcom/instagram/android/d/b/b;)V
    .locals 3
    .parameter

    .prologue
    .line 31
    const-string v0, "caption"

    iget-object v1, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/c;->s()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/instagram/android/d/b/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 32
    const-string v0, "upload_id"

    iget-object v1, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/c;->b()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/instagram/android/d/b/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 34
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 35
    iget-object v0, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/c;->L()Lcom/instagram/pendingmedia/model/h;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/h;->c()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/pendingmedia/model/g;

    .line 36
    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/g;->b()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 39
    :cond_0
    const/4 v0, 0x0

    .line 41
    :try_start_0
    invoke-direct {p0, v1}, Lcom/instagram/android/directshare/b/a/g;->a(Ljava/util/List;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 46
    :goto_1
    const-string v1, "recipients"

    invoke-virtual {p1, v1, v0}, Lcom/instagram/android/d/b/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 48
    iget-object v0, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/c;->c()Lcom/instagram/model/a/a;

    move-result-object v0

    sget-object v1, Lcom/instagram/model/a/a;->b:Lcom/instagram/model/a/a;

    if-ne v0, v1, :cond_1

    .line 49
    const-string v0, "video_result"

    iget-object v1, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/c;->z()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/instagram/android/d/b/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 51
    :cond_1
    return-void

    .line 42
    :catch_0
    move-exception v1

    .line 43
    const-string v1, "ConfigureDirectShareRequest"

    const-string v2, "Unable to put recipients into Json string."

    invoke-static {v1, v2}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1
.end method

.method public e()Z
    .locals 1

    .prologue
    .line 75
    const/4 v0, 0x1

    return v0
.end method

.method protected f()Ljava/lang/String;
    .locals 2

    .prologue
    .line 55
    iget-object v0, p0, Lcom/instagram/android/directshare/b/a/g;->a:Lcom/instagram/pendingmedia/model/c;

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/c;->c()Lcom/instagram/model/a/a;

    move-result-object v0

    sget-object v1, Lcom/instagram/model/a/a;->b:Lcom/instagram/model/a/a;

    if-ne v0, v1, :cond_0

    .line 56
    const-string v0, "direct_share/configure/?video=1"

    .line 58
    :goto_0
    return-object v0

    :cond_0
    const-string v0, "direct_share/configure/"

    goto :goto_0
.end method
